package com.tutu.aop.service.impl;

import com.tutu.aop.annotation.MyAdvice;
import com.tutu.aop.entity.User;
import com.tutu.aop.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @Program: SpringBoot
 * @Description: 业务层实现方法
 * @Author: JK.TuTu
 * @Create: 2022-11-04 10:39
 **/
@Service
public class UserServiceImpl implements UserService {

    @Override
    public void addUser(User user) {
        System.out.println("执行业务层addUser方法");
    }

    @Override
    public void deleteUser(String name) {
        System.out.println("业务层deleteUser方法");
    }

    @Override
    public void updateUser(User user) {
        System.out.println("业务层updateUser方法");
    }

    @Override
    public String getUser(int num) {
        System.out.println("业务层getUser方法");
        return num < 10 ? "查询成功" : "查询失败";
    }

    @Override
    @MyAdvice
    public String getUserById(int age,String name) {
        System.out.println("根据id查询用户.....");
        return name+age;
    }
}
